home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / applications / 3968 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  67 lines

  1. Path: ida.his.se!usenet
  2. From: a95hanne@ida.his.se (Hannu Nevalainen)
  3. Newsgroups: comp.sys.amiga.applications
  4. Subject: Re: Cap'n TextEd needs some help!
  5. Followup-To: comp.sys.amiga.applications
  6. Date: 30 Mar 1996 00:27:12 GMT
  7. Organization: NONE!
  8. Distribution: World
  9. Message-ID: <1576.6662T1327T1969@ida.his.se>
  10. References: <4j4dnq$f82@iac2.ltec.net> <DoztDI.5ut@rose.com>
  11. NNTP-Posting-Host: ipcsun2.ida.his.se
  12. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  13.  
  14.  
  15. > +On 28-Mar-96 20:41:41 A White
  16. > +<awhite@user.rose.com>
  17. > +wrote about "Re: Cap'n TextEd needs some help!"
  18. > +in "comp.sys.amiga.applications"...
  19.  
  20. > In article <4j4dnq$f82@iac2.ltec.net>, No Quarter <dl63832@ltec.net>
  21. > wrote:
  22. >>text file (200K plus) that consists of one line if text and 3 blank lines.
  23. >>I want to remove all blank lines so that I have single spaced ascii text
  24.  
  25.  I seem to have missed the original posting, so I'll reply on this one ;)
  26.  
  27.  As I understand it Mr/Ms/It(?) "No Quarter <dl63832@ltec.net>"   ;)
  28. wants to have ALL text in a file - on a single line.
  29.  This can be done quickly with ARexx
  30.  
  31. <sb>
  32. <sb> [ Enter this text into a file named "REXX:make_one_line.rexx" ]
  33. <sb>
  34. /* replace all LF's in a file with spaces */
  35.  
  36. parse arg infile outfile .
  37.  
  38. if (open(i,infile,'r')+open(o,outfile,'w')~=2) then
  39.    exit 20
  40.  
  41. l=32768;
  42. b=readch(i,l);
  43. do while ~eof(i);
  44.    call writech(o,translate(b,' ','0a'x));
  45.    b=readch(i,l);
  46. end;
  47. call writech(o,translate(b,' ','0a'x));
  48. <sb>
  49. <sb> [ eof ]
  50. <sb>
  51.  
  52. Then this will do "it"
  53.  
  54.  1> rx make_one_line file_to_convert outfile
  55.  
  56. And this may work, if you have REXX: in your path and a newer version of OS
  57.  
  58.  1> protect REXX:make_one_line.rexx +s
  59.  1> make_one_line file_to_convert outfile
  60.  
  61. /Hannu E.K. Nevalainen, Amiga since '85.        /*á1996-03-29á@19:25áCETá*/
  62. >> Inform yourself... http://www.amiga.de/      /*áThorá2.22á[1642]á*/
  63. <tsb> rexx:random(55 tags) -> "Acronyms_McInToch"
  64.  
  65.  Macintosh = Machine Always Crashes. If Not - The OS Hangs.
  66.  
  67.